package com.czkt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */

public class Orders implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单编号
     */
    @TableId(value = "odr_id", type = IdType.AUTO)
    private Long odrId;

    /**
     * 客户编号
     */
    private String odrCustomer;

    /**
     * 日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date odrDate;

    /**
     * 送货地址
     */
    private String odrAddr;

    /**
     * 状态
     */
    private String odrStatus;


    public Orders() {
    }

    public Orders(Long odrId, String odrCustomer, Date odrDate, String odrAddr, String odrStatus) {
        this.odrId = odrId;
        this.odrCustomer = odrCustomer;
        this.odrDate = odrDate;
        this.odrAddr = odrAddr;
        this.odrStatus = odrStatus;
    }

    /**
     * 获取
     * @return odrId
     */
    public Long getOdrId() {
        return odrId;
    }

    /**
     * 设置
     * @param odrId
     */
    public void setOdrId(Long odrId) {
        this.odrId = odrId;
    }

    /**
     * 获取
     * @return odrCustomer
     */
    public String getOdrCustomer() {
        return odrCustomer;
    }

    /**
     * 设置
     * @param odrCustomer
     */
    public void setOdrCustomer(String odrCustomer) {
        this.odrCustomer = odrCustomer;
    }

    /**
     * 获取
     * @return odrDate
     */
    public String getOdrDate() throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(odrDate);
    }

    /**
     * 设置
     * @param odrDate
     */
    public void setOdrDate(Date odrDate) {
        this.odrDate = odrDate;
    }

    /**
     * 获取
     * @return odrAddr
     */
    public String getOdrAddr() {
        return odrAddr;
    }

    /**
     * 设置
     * @param odrAddr
     */
    public void setOdrAddr(String odrAddr) {
        this.odrAddr = odrAddr;
    }

    /**
     * 获取
     * @return odrStatus
     */
    public String getOdrStatus() {
        return odrStatus;
    }

    /**
     * 设置
     * @param odrStatus
     */
    public void setOdrStatus(String odrStatus) {
        this.odrStatus = odrStatus;
    }

    public String toString() {
        return "Orders{odrId = " + odrId + ", odrCustomer = " + odrCustomer + ", odrDate = " + odrDate + ", odrAddr = " + odrAddr + ", odrStatus = " + odrStatus + "}";
    }
}
